<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>组件注册模板</title>
</head>

<body>
    <div class="app">
        <div>{{pmsg}}</div>
        <hello-vue :title='title' content='我是静态绑定的'></hello-vue>
    </div>

    <script src="./js/vue.js"></script>
    <script>
        Vue.component('hello-vue', {
            props: ['title', 'content'],
            data: function () {
                return {
                    msg: '我是子组件本来就有的数据，我不要绑定'
                }
            },
            template: `
            <div>
                <span>{{msg + '----' + title + '----' + content}}</span>
            </div>
            `
        })
        var xm = new Vue({
            el: '.app',
            data: {
                pmsg: '我是父亲自带的数据',
                title: '我是给子组件动态绑定的'
            }
        })



    </script>

</body>

</html>